<!doctype html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>只使用iframe上传的demo</title>
    <script src="http://g.tbcdn.cn/kissy/k/1.4.2/seed-min.js" charset="utf-8"></script>
</head>
<body>
<h2>只使用iframe上传的demo</h2>
<div class="grid">
    <input type="file" class="g-u" id="J_UploaderBtn" value="上传图片" name="Filedata" >
    <input type="hidden" id="J_Urls" name="urls" value="" />
</div>
<ul id="J_UploaderQueue" class="grid">

</ul>
<script>
    var S = KISSY;
    if (S.Config.debug) {
        var srcPath = "../../../../";
        S.config({
            packages:[
                {
                    name:"gallery",
                    path:srcPath,
                    charset:"utf-8"
                }
            ]
        });
    }

    S.use('gallery/uploader/1.5.4/index,gallery/uploader/1.5.4/themes/imageUploader/index,gallery/uploader/1.5.4/themes/imageUploader/style.css', function (S, Uploader,ImageUploader) {
        //上传组件插件
        var plugins = 'gallery/uploader/1.5.4/plugins/auth/auth,' +
                'gallery/uploader/1.5.4/plugins/urlsInput/urlsInput,' +
                'gallery/uploader/1.5.4/plugins/preview/preview';

        S.use(plugins,function(S,Auth,UrlsInput,Preview){
            var uploader = new Uploader('#J_UploaderBtn',{
                // 上传方式切成flash
                type : "iframe",
                data:{"name":"minghe"},
                action:"upload.php"
            });
            //使用主题
            uploader.theme(new ImageUploader({
                queueTarget:'#J_UploaderQueue'
            }))
            //验证插件
            uploader.plug(new Auth({
                        max:3,
                        maxSize:500
                    }))
                    //url保存插件
                    .plug(new UrlsInput({target:'#J_Urls'}))
                    //图片预览
                    .plug(new Preview())
            ;
        });
    })
</script>
</body>
</html>
